package com.clqteam.controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.clqteam.model.Employee;
import com.clqteam.service.TempOrderService;
import com.clqteam.serviceimpl.TempOrderServiceImpl;

/**
 * 创建退货订单控制层
 * @author AdministratorZHX
 *
 */
public class CreateRejectOrderController extends HttpServlet{

TempOrderService toSer = new TempOrderServiceImpl();
	
	
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		doPost(req, resp);
	}
	
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		
		req.setCharacterEncoding("UTF8");
		resp.setCharacterEncoding("UTF8");	
		
		HttpSession session = req.getSession();
		Employee e = (Employee)session.getAttribute("employee");
		int eId = e.geteId();
		String tbName = "s_RejectOrder_"+eId;
		
		int flag = toSer.CreatTempOrder(tbName);		
		
		PrintWriter pw = resp.getWriter();
		pw.write(String.valueOf(flag));
		pw.flush();
		pw.close();		
		
	}
	

}
